//
//  FenleiCollectionViewCell.m
//  A_HandHeldLOL
//
//  Created by Zhao YanBin on 16/1/22.
//  Copyright © 2016年 zhaoyanbin. All rights reserved.
//

#import "FenleiCollectionViewCell.h"

@implementation FenleiCollectionViewCell
- (void)dealloc
{
    [_img release];
    [_name release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.name = [[UILabel alloc] init];
        _name.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_name];
        
        self.img = [[UIImageView alloc] init];
        _img.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_img];
    }
    return self;
}
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _name.frame = CGRectMake(0, layoutAttributes.size.height - 20, layoutAttributes.size.width, 20);
    _img.frame = CGRectMake(0, 0, layoutAttributes.size.width, layoutAttributes.size.height - 20);
}

@end
